<template>
  <div class="not-found">
    <div class="not-found-content">
      <h1>404</h1>
      <p class="message">抱歉，您访问的页面不存在</p>
      <a-button type="primary" size="large" @click="goHome">返回首页</a-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user'

const router = useRouter()
const userStore = useUserStore()

const goHome = () => {
  // 根据用户角色跳转到对应的首页
  if (!userStore.isLoggedIn) {
    router.push('/login')
  } else if (userStore.isPlatformAdmin) {
    router.push('/platform/dashboard')
  } else {
    router.push('/tenant/dashboard')
  }
}
</script>

<style scoped>
.not-found {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-gray);
}

.not-found-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.not-found h1 {
  font-size: 120px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.message {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 24px 0 32px;
}
</style>

